package org.fastsyncer.common.entity;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class MappingTask extends Task {

	private static final long serialVersionUID = 458010454337723960L;

	// 映射名称
	private String name;

	// 数据源配置
	private Object sourceConfig;

	// 目标源配置
	private Object targetConfig;

	// 数据源驱动
	private String sourceConnector;

	// 目标源驱动
	private String targetConnector;

	// 数据源同步字段类型,例如：[{name=ID, type=4}, {name=NAME, type=12}]
	private List<HashMap<String, Object>> sourceFileds;

	// 目标源同步字段类型
	private List<HashMap<String, Object>> targetFileds;

	// 数据源执行命令
	private Map<String, String> sourceExcuteCommond = new HashMap<String, String>();

	// 目标源执行命令
	private Map<String, String> targetExcuteCommond = new HashMap<String, String>();

	// 数据源总数据量
	private Integer sourceRowCount;

	// 目标源总数据量
	private Integer targetRowCount;

	// 过滤条件
	// "and":[{"name":"ID","operator":"equal","value":"111"},{"name":"ID","operator":"notEqual","value":"222"}]
	private HashMap<String, List<HashMap<String, String>>> query;

	// 策略
	private HashMap<String, HashMap<String, String>> policy;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Object getSourceConfig() {
		return sourceConfig;
	}

	public void setSourceConfig(Object sourceConfig) {
		this.sourceConfig = sourceConfig;
	}

	public Object getTargetConfig() {
		return targetConfig;
	}

	public void setTargetConfig(Object targetConfig) {
		this.targetConfig = targetConfig;
	}

	public String getSourceConnector() {
		return sourceConnector;
	}

	public void setSourceConnector(String sourceConnector) {
		this.sourceConnector = sourceConnector;
	}

	public String getTargetConnector() {
		return targetConnector;
	}

	public void setTargetConnector(String targetConnector) {
		this.targetConnector = targetConnector;
	}

	public List<HashMap<String, Object>> getSourceFileds() {
		return sourceFileds;
	}

	public void setSourceFileds(List<HashMap<String, Object>> sourceFileds) {
		this.sourceFileds = sourceFileds;
	}

	public List<HashMap<String, Object>> getTargetFileds() {
		return targetFileds;
	}

	public void setTargetFileds(List<HashMap<String, Object>> targetFileds) {
		this.targetFileds = targetFileds;
	}

	public Map<String, String> getSourceExcuteCommond() {
		return sourceExcuteCommond;
	}

	public void setSourceExcuteCommond(Map<String, String> sourceExcuteCommond) {
		this.sourceExcuteCommond = sourceExcuteCommond;
	}

	public Map<String, String> getTargetExcuteCommond() {
		return targetExcuteCommond;
	}

	public void setTargetExcuteCommond(Map<String, String> targetExcuteCommond) {
		this.targetExcuteCommond = targetExcuteCommond;
	}

	public Integer getSourceRowCount() {
		return sourceRowCount;
	}

	public void setSourceRowCount(Integer sourceRowCount) {
		this.sourceRowCount = sourceRowCount;
	}

	public Integer getTargetRowCount() {
		return targetRowCount;
	}

	public void setTargetRowCount(Integer targetRowCount) {
		this.targetRowCount = targetRowCount;
	}

	public HashMap<String, List<HashMap<String, String>>> getQuery() {
		return query;
	}

	public void setQuery(HashMap<String, List<HashMap<String, String>>> query) {
		this.query = query;
	}

	public HashMap<String, HashMap<String, String>> getPolicy() {
		return policy;
	}

	public void setPolicy(HashMap<String, HashMap<String, String>> policy) {
		this.policy = policy;
	}

	@Override
	public String toString() {
		return "MappingTask [name=" + name + ", sourceConfig=" + sourceConfig + ", targetConfig=" + targetConfig
				+ ", sourceConnector=" + sourceConnector + ", targetConnector=" + targetConnector + ", sourceFileds="
				+ sourceFileds + ", targetFileds=" + targetFileds + ", sourceExcuteCommond=" + sourceExcuteCommond
				+ ", targetExcuteCommond=" + targetExcuteCommond + ", sourceRowCount=" + sourceRowCount
				+ ", targetRowCount=" + targetRowCount + ", query=" + query + ", policy=" + policy + "]";
	}

}
